package com.smrs.deliver.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jof.framework.dao.hibernate.BaseDAOHibernateImpl;
import com.jof.framework.util.Pager;
import com.smrs.deliver.dao.DeliverDetailDao;
import com.smrs.deliver.model.DeliverDetailModel;
import com.smrs.deliver.model.DeliverHeaderModel;
import com.smrs.goods.model.GoodsSkuModel;
import com.smrs.service.BaseService;

@Component(value="deliverDetailService")
public class DeliverDetailService extends BaseService<DeliverDetailModel,Long>{
	@Autowired
	private DeliverDetailDao deliverDetailDao ;

	public Pager<DeliverDetailModel> getByNameLikePager(String name, Pager<DeliverDetailModel> pager){
		return deliverDetailDao.getByNameLikePager(name,pager);
		
	}
	
	public Pager<DeliverDetailModel> findBySkuAndDeliverHeader(GoodsSkuModel sku,DeliverHeaderModel deliverHeader,Pager<DeliverDetailModel> pager){
		//List<DeliverDetailModel> list =
		Pager<DeliverDetailModel> tempPager =  deliverDetailDao.findBySkuAndDeliverHeader(sku,deliverHeader,pager);
		return tempPager;
	}
	
	public List<DeliverDetailModel> findByDeliverHeader(DeliverHeaderModel deliverHeader){
		List<DeliverDetailModel>  list = deliverDetailDao.findByDeliverHeader(deliverHeader);
		return list;
	}
	
	@Override
	public BaseDAOHibernateImpl<DeliverDetailModel, Long> getPerformDao() {		
		return deliverDetailDao;
	}


	
	
}
